home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / vidbasic.zip / VBLINK.ASM < prev    next >
Assembly Source File  |  1990-11-29  |  3KB  |  78 lines

  1. ;«RM82»«TS8,16,24,32,40,48,56,64»
  2. ; Updated 11/20/90
  3.  
  4. ;============================================================================
  5. ;   Copyright (C) Copr. 1990 by Sidney J. Kelly
  6. ;           All Rights Reserved.
  7. ;           Sidney J. Kelly
  8. ;           150 Woodhaven Drive
  9. ;           Pittsburgh, PA 15228
  10. ;           home phone 412-561-0950 (7pm to 9:30pm EST)
  11. ;============================================================================
  12.  
  13. DOSSEG
  14. .model medium, Basic
  15. .code
  16.  
  17. ;============================================================================
  18. ; DECLARE SUB SETBLINK (BYVAL Status%)
  19. ; Purpose:
  20. ;       Toggles background blinking/intensity for MONO, CGA, EGA, VGA
  21. ;       allows use of background colors that would otherwise flash
  22. ; Parameters:
  23. ;       =  0 turn off blinking, enable intensity
  24. ;       <> 0 to turn it on again
  25. ; Returns:
  26. ;       nothing
  27. ;============================================================================
  28.  
  29. EVEN
  30. SETBLINK Proc FAR BASIC STATUS:ptr word
  31.     Xor             BX,BX
  32.     Mov             ES,BX              ; set ES to BIOS RAM
  33.  
  34. EGATest:
  35.     Mov             AX,1200h           ; read EGA/VGA config
  36.     Mov             BX,10h
  37.     Int             10h
  38.     Cmp             BL,10h             ; EGA changes BL from 10h
  39.     Je              CGA_Adjust         ; no change in BL so have CGA/MDA
  40.     Cmp             CL,6               ; determine primary monitor type
  41.                        ; EGA/VGA is primary monitor if CL
  42.                        ; is greater or = to 6
  43.     JAE             EGA_Adjust         ; primary adapter EGA/VGA
  44.  
  45. CGA_Adjust:                                ; not a VGA/EGA or inactive
  46.                        ; so treat as a CGA/Mono
  47.     Mov             BX,STATUS          ; read input number
  48.     Mov             DX,ES:[0463h]      ; read base port address for CRT
  49.     ADD             DL,04h             ; CGA/Mono independent code
  50.     Mov             AL,ES:[0465h]      ; read current setting of CRT mode
  51.                        ; register
  52.     OR              BX,BX              ; see if user input is 0
  53.     JZ              SETB1              ; if zero
  54.     OR              AL,20h             ; set bit
  55.     Jmp             Short SETB2
  56. SETB1:
  57.     And             AL,0DFh            ; clear bits
  58. SETB2:
  59.     Out             DX,AL              ; send to CRT corrected settings
  60.     Mov             ES:[0465h],AL      ; write back current CRT mode
  61.     Jmp             Short SETB_END
  62.  
  63. EGA_Adjust:
  64.  
  65.     Mov             BX,STATUS          ; read input number
  66.     OR              BX,BX              ; see if user input is 0
  67.     JZ              SETB3              ; if 0 then jump forward
  68.     Mov             BL,01              ; set bit for blinking
  69. SETB3:
  70.     Mov             AX,1003h           ; do it to EGA/VGA
  71.                        ; if BL = 1 then blinking enabled
  72.                        ; if BL = 0 then intensity enabled
  73.     Int             10h
  74. SETB_END:                                  ; quit
  75.     Ret                                ; MASM cleans up stack
  76. SETBLINK        ENDP
  77. END
  78.